﻿Imports System.ComponentModel

Namespace MVVM

    Public MustInherit Class ViewModelBase
        Implements INotifyPropertyChanged

#Region " Declarations "

        Private _strViewModelFriendlyName As String = String.Empty

#End Region

#Region " Events "

        Public Event PropertyChanged(ByVal sender As Object, ByVal e As System.ComponentModel.PropertyChangedEventArgs) Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged

#End Region

#Region " Properties "

        Public Overridable Property ViewModelFriendlyName() As String
            Get
                Return _strViewModelFriendlyName
            End Get
            Set(ByVal Value As String)
                _strViewModelFriendlyName = Value
                OnPropertyChanged("ViewModelFriendlyName")
            End Set
        End Property

#End Region

#Region " Constructor "

        Public Sub New()
        End Sub

#End Region

#Region " PropertyChanged Methods "

        Protected Sub OnPropertyChanged(ByVal strPropertyName As String)

            If Me.PropertyChangedEvent IsNot Nothing Then
                RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(strPropertyName))
            End If

        End Sub

#End Region

    End Class

End Namespace
